import logging
import utils.utils as utils
from db.oracledb import oracledb
from db.mssqldb import mssqldb
from dispatcher.luncher  import lunchApplication
import sys
import os

if __name__ == "__main__":
    try:
        utils.setIniFile(sys.argv[1])
    except IndexError:
        print 'No configuracion file given!!!'
        
    standardFile=sys.argv[0][0:-4]+'.ini'
    
    if os.path.isfile(standardFile):
        utils.setIniFile(standardFile)
        print 'Default INI file used...'
          
    logger = logging.getLogger('automatic')
    utils.configureLoger(logger)
    
    
    allSections = utils.getAllSections()
    lunchApplication(allSections)
    


   
      

